import { defineStore } from "pinia";
import axios from "axios";
import { ref, onMounted } from "vue";
import { getGoodsApi, deleteGoodsApi } from '@/api/goods'

export const useGoodsStore = defineStore("goods", () => {
  const goods = ref([])

  const getGoods = async () => {
    goods.value = await getGoodsApi()
    // const response = await axios.get("http://localhost:3000/goods")
    // goods.value = response.data
  }
  



  getGoods()
  return { goods , getGoods }
})

